package csel.controller.bindings;

import csel.controller.enums.ActionEnum;

public class ActionBindings extends AbstractBindings<String, ActionEnum>
{
	/**
	 * This class uses a concurrent hashmap parameterized with String keys and
	 * ActionEnum values, it has a default set of bindings and allows the
	 * bindings to be updated and for values to be retrieved based off of a
	 * certain key.
	 */
	private static ActionBindings instance;

	/**
	 * The constructor for this class takes no parameters. It adds all the default bindings we want
	 * our game to have. As new actions that need bindings are created they
	 * need to be added to this constructor.
	 */
	private ActionBindings()
	{
		super();
		updateBinding(StringActionCommands.SP_NEW, 					ActionEnum.SP_NEW);
		updateBinding(StringActionCommands.SP_LOAD, 				ActionEnum.SP_LOAD);
		updateBinding(StringActionCommands.SP_QUIT, 				ActionEnum.SP_QUIT);
		updateBinding(StringActionCommands.BM_SKILLS_UPGRADE, 		ActionEnum.BM_SKILLS_UPGRADE);
		updateBinding(StringActionCommands.BM_SKILLS_USESELF, 		ActionEnum.BM_SKILLS_USESELF);
		updateBinding(StringActionCommands.BM_SKILLS_USEOTHER, 		ActionEnum.BM_SKILLS_USEOTHER);
		updateBinding(StringActionCommands.CHANGE_BINDINGS,			ActionEnum.CHANGE_BINDINGS_SHOW);
		updateBinding(StringActionCommands.HIDE_DIALOG,				ActionEnum.HIDE_DIALOG);
		updateBinding(StringActionCommands.BM_SYSTEM_NEW,			ActionEnum.BM_NEW);
		updateBinding(StringActionCommands.BM_SYSTEM_LOAD, 			ActionEnum.BM_LOAD);
		updateBinding(StringActionCommands.BM_SYSTEM_SAVE,			ActionEnum.BM_SAVE);
		updateBinding(StringActionCommands.BM_SYSTEM_CONTROLS, 		ActionEnum.BM_CHANGE_CONTROLS);
		updateBinding(StringActionCommands.BM_SYSTEM_QUIT,			ActionEnum.BM_QUIT);
		updateBinding(StringActionCommands.ATTACK,					ActionEnum.ATTACK);
		updateBinding(StringActionCommands.SHOW_NPC_DIALOG, 		ActionEnum.SHOW_NPC_DIALOG);
		updateBinding(StringActionCommands.SHOW_TRADE_DIALOG, 		ActionEnum.SHOW_TRADE_DIALOG);
		updateBinding(StringActionCommands.BUY, 					ActionEnum.BUY);
		updateBinding(StringActionCommands.SELL,					ActionEnum.SELL);
	}

	public static ActionBindings getInstance()
	{
		if (instance == null)
		{
			instance = new ActionBindings();
		}
		return instance;
	}
	
}
